package com.hrt.bean;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Version;


/***********************************************************************
 * Module:  ProductDetails.java
 * 产品详细信息
 * Author:  Administrator
 * Purpose: Defines the Class ProductDetails
 ***********************************************************************/
@Entity
@Table(name = "PRODUCT_DETAILS")
public class ProductDetails implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 420917312435392278L;

	/**
	 * 详细ID
	 * 
	 * @pdOid 8ba372a1-d53c-46bd-bed2-1174d06b2c3e
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "DE_ID")
	private Long id;
	
	
	
	@Column(name = "PRO_ID",insertable=false,updatable=false)
	private Long proId;
	
	

	/**
	 * 产品编号
	 * 
	 * @pdOid 8f843bf0-92d5-4e8b-89ca-33e7c4a6b33b
	 */
	@Column(name = "PRO_CODE",nullable=false)
	private String proCode;
	/**
	 * 产品名称
	 * 
	 * @pdOid cf05ee7d-8d94-4891-a6c5-1ad4b2e39a61
	 */
	@Column(name = "PRO_NAME",nullable=false)
	private String proName;

	/**
	 * 产品主图片
	 * 
	 * @pdOid e12fee9c-2ea2-4e10-a05b-9ee822a7456c
	 */
	@Column(name = "PIC",nullable=true)
	private String pic;
	/**
	 * 产品颜色
	 * 
	 * @pdOid 96929fe7-358f-4444-b1ac-977672a3f6cf
	 */
	@Column(name = "COLOR",nullable=true)
	private String color;

	/**
	 * 成本价
	 * 
	 * @pdOid 7e31f29b-701a-4b24-afea-52b4fde75cab
	 */
	@Column(name = "ENTER_PRICE",nullable=false)
	private Double enterPrice = 0d;
	/**
	 * 零售价格
	 * 
	 * @pdOid dba53926-fed1-47f8-9c78-0f238381bff5
	 */
	@Column(name = "SALE_PRICE",nullable=false)
	private Double salePrice = 0d;
	/**
	 * 描述
	 * 
	 * @pdOid ac849935-19e7-4672-a4c7-ecb7a3ee496b
	 */
	@Column(name = "DESCRIPTION",nullable=true)
	private String description;
	/**
	 * 库存量
	 * 
	 * @pdOid f575db2e-1017-4c8e-92b1-55b56186a1e3
	 */
	@Column(name = "TOTAL",nullable=false)
	private Long total = 0l;
	/**
	 * 产品录入人ID,关联后台用户表主键
	 * 
	 * @pdOid 9a9a89d6-c168-4c63-9b34-d899661684da
	 */
	@Column(name = "CREATE_ID",nullable=false)
	private Long createId;
	/**
	 * 录入人名称
	 * 
	 * @pdOid 4ea85892-1a6f-4748-a919-b6b5e1e882da
	 */
	@Column(name = "CRREATOR",nullable=false)
	private String creator;
	/**
	 * 创建时间, 默认系统当前时间
	 * 
	 * @pdOid 474f9791-5e36-40e7-b81a-5e472e07ffb5
	 */
	@Column(name = "CREATE_TIME",nullable=false)
	private java.sql.Date creatTime=new java.sql.Date(new java.util.Date().getTime());
	/**
	 * 修改人,第一次插入数据时，修改人与创建人一致
	 * 
	 * @pdOid 0b61fbbf-8f9b-432f-8bcf-1fd989c5559f
	 */
	@Column(name = "EDITOR",nullable=false)
	private String editor;
	/**
	 * 产品修改人ID,关联后台用户表主键
	 * 
	 * @pdOid 06e70dbd-e3c5-4e78-a3af-e0011512eec1
	 */
	@Column(name = "EDITOR_ID",nullable=false)
	private Long editorId;
	/**
	 * 最后修改时间,录入数据时，录入时间和最后修改时间一致
	 * 
	 * @pdOid bd43ef7d-cd46-4fe0-99cd-5930d87e3200
	 */
	@Column(name = "EDIT_TIME",nullable=false)
	private java.sql.Date editTime;
	/**
	 * 删除标记 0未删除 1已删除
	 * 
	 * @pdOid b6788b02-fa31-472c-95bc-4981a9219427
	 */
	@Column(name = "ISDELETE",nullable=false)
	private Integer isdelete = 0;
	
	@Column(name = "MIN_TOTAL",nullable=false)
	private Long minTotal=0l;

	
	/**
	 * 是否是样品
	 * 0正式产品，1样品
	 */
	@Column(name = "ISDEMO", nullable = false)
	private Integer isdemo = 1;
	
	/** @pdRoleInfo migr=no name=ProductInfor assc=reference12 mult=1..1 side=A */
	@ManyToOne(cascade = {CascadeType.REFRESH, CascadeType.MERGE}, optional = false)
	@JoinColumn(name = "PRO_ID")
	private ProductInfor productInfor;
	
	
	
	/**
	 * 规格编号
	 */
	
	
	@Column(name = "RULE_CODE",nullable=true)
	private String ruleCode;
	
	/**
	 * 规格名称
	 */
	@Column(name = "RULE_NAME",nullable=true)
	private String ruleName;
	
	

	/**
	 * 产品规格
	 * 宽度
	 */
	@Column(name = "WIDTH",nullable=false)
	private Double width=0d;
	
	/**
	 * 产品规格
	 * 高度
	 */
	@Column(name = "HEIGHT",nullable=false)
	private Double height=0d;
	
	/**
	 * 产品规格
	 * 长度
	 */
	@Column(name = "LONGNESS",nullable=false)
	private Double longness=0d;

	
	
	/**
	 * 可用库存
	 */
	@Column(name = "USEFUL")
	private Long useful=0l;
	
	@Version
	@Column(name = "VERSION", nullable = false)
	private int version=1;
	

	public Long getUseful() {
		return useful;
	}
	public void setUseful(Long useful) {
		this.useful = useful;
	}
	
	
	/** @pdOid 70115cd4-525a-4917-b66d-554e11077996 */
	public Long getId() {
		return id;
	}

	/**
	 * @param newId
	 * @pdOid e2f2fd29-0ccb-423b-9e25-98566b68889e
	 */
	public void setId(Long newId) {
		id = newId;
	}
	public Long getProId() {
		return proId;
	}

	
	public void setProId(Long proId) {
		this.proId = proId;
	}

	public void setProductInfor(ProductInfor productInfor) {
		this.productInfor = productInfor;
	}
	

	/** @pdOid a179a9a5-ddf7-48df-91e3-3b2e7680e37a */
	public String getProCode() {
		return proCode;
	}

	/**
	 * @param newProCode
	 * @pdOid 3bd30261-4223-4246-abe4-6489657b4b45
	 */
	public void setProCode(String newProCode) {
		proCode = newProCode;
	}

	/** @pdOid f13326e7-4009-4dc7-b128-d1a8b7dcb88b */
	public String getProName() {
		return proName;
	}

	/**
	 * @param newProName
	 * @pdOid 1365dccc-ce38-4a9e-a540-5f5cfeb28025
	 */
	public void setProName(String newProName) {
		proName = newProName;
	}

	/** @pdOid a1d190bc-1ff1-4096-8642-b8d05bac57cc */
	

	/** @pdOid 37c1836f-77a4-4601-bd2f-1e374885aa53 */
	public String getPic() {
		return pic;
	}

	/**
	 * @param newPic
	 * @pdOid 7982a593-0455-45e6-bdb3-9b57a9b1272c
	 */
	public void setPic(String newPic) {
		pic = newPic;
	}

	/** @pdOid 02ab32a5-dac3-4a8e-b4a7-1ce64d102db4 */
	public String getColor() {
		return color;
	}

	/**
	 * @param newColor
	 * @pdOid cb26bc5b-6368-41a2-923b-d5f8f496bb07
	 */
	public void setColor(String newColor) {
		color = newColor;
	}

	
	/** @pdOid b148e3cf-fba4-4b5f-9719-7f4a57005fe1 */
	public Double getEnterPrice() {
		return enterPrice;
	}

	/**
	 * @param newEnterPrice
	 * @pdOid 0dae02f4-770c-42f5-8ba5-6cb3ab02c09b
	 */
	public void setEnterPrice(Double newEnterPrice) {
		enterPrice = newEnterPrice;
	}

	/** @pdOid 9363f988-d8d0-4e82-a608-333d896250c2 */
	public Double getSalePrice() {
		return salePrice;
	}

	/**
	 * @param newSalePrice
	 * @pdOid 4edae87c-c825-4710-ac9c-0422c0fc8799
	 */
	public void setSalePrice(Double newSalePrice) {
		salePrice = newSalePrice;
	}

	/** @pdOid e48877df-bcff-4bfa-b5d4-e23b4a84bae8 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param newDescription
	 * @pdOid 3ec23d96-7e31-4d4c-b26e-0cbf457a8895
	 */
	public void setDescription(String newDescription) {
		description = newDescription;
	}

	/** @pdOid 16040d08-b551-4459-a0f2-885ea9f37b1a */
	public Long getTotal() {
		
		if(total==null)
		{
			total=0l;
		}
		
		return total;
	}

	/**
	 * @param newTotal
	 * @pdOid b82265c3-2b75-43dc-b135-5ac627b83f91
	 */
	public void setTotal(Long newTotal) {
		total = newTotal;
	}

	/** @pdOid a8a6e5af-da69-4811-8703-2dcdb99f137b */
	public Long getCreateId() {
		return createId;
	}

	/**
	 * @param newCreateId
	 * @pdOid 41e75d54-7d4f-4f48-9dee-47d642fb41a8
	 */
	public void setCreateId(Long newCreateId) {
		createId = newCreateId;
	}

	/** @pdOid 71e52f66-9b1e-41a2-a8e1-216942088d2f */
	public String getCreator() {
		return creator;
	}

	/**
	 * @param newCreator
	 * @pdOid fe51c468-1ef3-420b-ac68-060f5da4c08c
	 */
	public void setCreator(String newCreator) {
		creator = newCreator;
	}

	/** @pdOid f1d9a72c-c7c8-4ae0-bd5f-f096551d980f */
	public java.sql.Date getCreatTime() {
		return creatTime;
	}

	/**
	 * @param newCreatTime
	 * @pdOid 0351f785-9fcc-4212-8c7c-f084702390b1
	 */
	public void setCreatTime(java.sql.Date newCreatTime) {
		creatTime = newCreatTime;
	}

	/** @pdOid 39976cef-4853-432c-9763-bcb1bde1feb0 */
	public String getEditor() {
		return editor;
	}

	/**
	 * @param newEditor
	 * @pdOid 6fab321a-71ec-4e49-8974-5a290ec59b2f
	 */
	public void setEditor(String newEditor) {
		editor = newEditor;
	}

	/** @pdOid e93be0b5-7778-43fc-8fd8-5cd76c3a6ab0 */
	public Long getEditorId() {
		return editorId;
	}

	/**
	 * @param newEditorId
	 * @pdOid 37de349c-ea06-4c4e-b308-4578397cc44b
	 */
	public void setEditorId(Long newEditorId) {
		editorId = newEditorId;
	}

	/** @pdOid 7d7c7aa4-ce1f-4826-8499-2b85fcb57007 */
	public java.sql.Date getEditTime() {
		return editTime;
	}

	/**
	 * @param newEditTime
	 * @pdOid da5b8803-757e-4dd7-9f51-6db68ab39505
	 */
	public void setEditTime(java.sql.Date newEditTime) {
		editTime = newEditTime;
	}

	/** @pdOid e66802a1-c858-4589-a183-0aa3fe6fa716 */
	public Integer getIsdelete() {
		return isdelete;
	}

	/**
	 * @param newIsdelete
	 * @pdOid a086ffc4-c6b0-42f0-a106-cfd7bf7727ba
	 */
	public void setIsdelete(Integer newIsdelete) {
		isdelete = newIsdelete;
	}

	/** @pdGenerated default parent getter */
	
	public ProductInfor getProductInfor() {
		return productInfor;
	}

	public Double getWidth() {
		return width;
	}

	public void setWidth(Double width) {
		this.width = width;
	}

	public Double getHeight() {
		return height;
	}

	public void setHeight(Double height) {
		this.height = height;
	}

	public Double getLongness() {
		return longness;
	}

	public void setLongness(Double longness) {
		this.longness = longness;
	}
	
	public String getRuleCode() {
		return ruleCode;
	}
	public String getRuleName() {
		return ruleName;
	}
	public void setRuleCode(String ruleCode) {
		this.ruleCode = ruleCode;
	}
	public void setRuleName(String ruleName) {
		this.ruleName = ruleName;
	}
	public int getVersion() {
		return version;
	}
	public void setVersion(int version) {
		this.version = version;
	}
	public Integer getIsdemo() {
		return isdemo;
	}
	public void setIsdemo(Integer isdemo) {
		this.isdemo = isdemo;
	}
	public Long getMinTotal() {
		return minTotal;
	}
	public void setMinTotal(Long minTotal) {
		this.minTotal = minTotal;
	}
	

	
}
